﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpDwgDxfInterface.h"
#include "ElementId.h"
#include <set>
#include <vector>

namespace gcmp
{
    class IGraphicsNode;
    class IModelView;
    class IPlane;

    /// \brief  机电参与出图的构件类型
    enum class MepElementType : int32_t
    {
        Unknown = 0,    ///< 未知    
        Cable = 1,      ///< 导线    
        Tray = 2,       ///< 桥架    
        Equipment = 3,  ///< 设备
        Others = 4      ///< 其他类型 
    };

    /// \brief 需要进行遮挡退让的构件信息
    struct GCMP_DWG_DXF_INTERFACE_EXPORT HiddenLineRetreatElementInfo
    {
        ElementId Id;                      ///< 构件Id
        std::set<ElementId> ConnectedIds;  ///< 与当前构件相连的其他构件集合，连接构件不会进行消隐退让
        std::set<ElementId> HiddenIds;     ///< 指定的遮挡关系，所有遮挡当前构件的其他构件集合
        MepElementType      ElementType;   ///< 构件的类型，比如导线、桥架、设备等

        /// \brief 默认构造函数
        HiddenLineRetreatElementInfo();
    };
   
    /// \brief 需要进行遮挡退让的构件信息
    /// \note 如果Converter为nullptr，将放弃导出HiddenLineRetreatElements里面所有的构件
    struct GCMP_DWG_DXF_INTERFACE_EXPORT HiddenLineRetreatSettings
    {
        std::vector<HiddenLineRetreatElementInfo> HiddenLineRetreatElements;  ///< 需要进行遮挡退让的构件信息
        double OuterRetreatDist;                                              ///< 外侧退让距离
        double InnerRetreatDist;                                              ///< 内侧退让距离
        double CurveRetreatDist;                                              ///< 单线退让距离

        /// \brief 默认构造函数
        HiddenLineRetreatSettings();

    private:
        // 禁止拷贝和赋值
        HiddenLineRetreatSettings(const HiddenLineRetreatSettings& other);
        HiddenLineRetreatSettings& operator=(const HiddenLineRetreatSettings& other);
    };
}
